package com.zuimei.zuimei.adapters;

import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.zuimei.zuimei.beans.EveryDBean;
import com.zuimei.zuimei.fragments.EveryDXQFragment;

import java.util.List;

/**
 * Created by pc on 2017/1/18.
 */
public class EveryDpagerAdapter extends FragmentPagerAdapter{
    private final List<EveryDBean.DataBean.AppsBean> data;

    public EveryDpagerAdapter(FragmentManager fm, List<EveryDBean.DataBean.AppsBean> list) {
        super(fm);
        this.data=list;
    }

    @Override
    public Fragment getItem(int position) {
        Fragment fragment=new EveryDXQFragment();
        Bundle bundle=new Bundle();
        bundle.putSerializable("data",data.get(position));
        fragment.setArguments(bundle);
        return fragment;
    }

    @Override
    public int getCount() {
        return data.size();
    }
}
